﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html" encoding="utf-8" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
  <xsl:param name="tipoSalida"></xsl:param>
  <xsl:param name="noNegociable"></xsl:param>
  <xsl:param name="depositoCuenta"></xsl:param>
  <xsl:param name="poliza"></xsl:param>
  <xsl:decimal-format name="dollar"
decimal-separator="." grouping-separator=","/>
  <xsl:variable name="dominio" select="'http://localhost:50860/'"/>
    <xsl:template match="/SalidaDinero">
      <html>
        <head></head>
        <body>
          <style>
            #ContenedorCheque{position:absolute; width:1000px;}

            #ContenedorChequePapel{position:absolute;top:-14px;left:460px;width:468px;height:202px; font-size:11px; font-family:arial; font-weight: bold; text-transform:uppercase;}
            <xsl:if test="$tipoSalida=1">
              #ContenedorCheque{position:relative; width:800px;}

              #ContenedorChequePapel{position:absolute;top:0px;left:0px;width:468px;height:202px; font-size:11px; font-family:arial; font-weight: bold; text-transform:uppercase;}
            </xsl:if>
          </style>
      <div id="ContenedorCheque">
        <div id="ContenedorChequePapel" >
          <div id="ChequeDiv" style="position:absolute; top:5px;left:-10px;">
            <xsl:if test="$tipoSalida=1">
              <div style="position:absolute; top:245px; left:415px;">
                
                Cheque No. <xsl:value-of select="format-number(@NoCheque, '0000000','dollar')"/>
              </div>
              <xsl:if test="$poliza=''">
              <xsl:element name="img">
                <xsl:attribute name="src">
                  <xsl:value-of select="concat($dominio,'XMLCss/images/santander.png')"/>
                </xsl:attribute>
                <xsl:attribute name="align">left</xsl:attribute>
              </xsl:element>
                </xsl:if>
            </xsl:if>
          </div>

          <div style="position:absolute; top:35px; left:349px; width:200px;">
            <xsl:call-template name="FormatDate">
              <xsl:with-param name="DateTime" select="@FechaPago"/>

            </xsl:call-template>
          </div>
          <div style="position:absolute; top:90px; left:45px;width:400px;">
            <xsl:value-of select="@ANombreDe"/>
          </div>
          <div style="position:absolute; top:125px; left:45px;width:600px;">
            #(<xsl:value-of select="@MontoLetra"/> M.N.)#
          </div>
          <div style="position:absolute; top:90px; left:450px;">
            <xsl:value-of select="format-number(@Monto, '#,##0.00','dollar')"/>
          </div>
          <xsl:if test="$noNegociable='True'">
            <div style="position:absolute; top:147px; left:20px;font-size:13px;">
              --- NO NEGOCIABLE ---
            </div>
          </xsl:if>
          <xsl:if test="$depositoCuenta='True'">
            <div style="position:absolute; top:210px; left:20px;font-size:13px;">
              --- PARA ABONO EN CUENTA DEL BENEFICIARIO ---
            </div>
          </xsl:if>
          <xsl:if test="$poliza='True'">
            
            <div style="position:absolute; top:390px; left:70px;">
              <xsl:value-of select="@Concepto"/>
            </div>
          </xsl:if>
          <xsl:if test="$tipoSalida=1">
            <div style="position:absolute; top:170px; left:0px; width:100%; text-align:center; font-size:35px; opacity: .3; filter: alpha(opacity=30);
	-ms-filter: 'alpha(opacity=30)';	-khtml-opacity: .3;-moz-opacity: .3;">
              <xsl:if test="@cobrado='true'">
                <span style="color:green;">PAGADO</span>
              </xsl:if>
              <xsl:if test="@cancelado='true'">
                <span style="color:red;">CANCELADO</span>
              </xsl:if>
            </div>
          </xsl:if>
          <xsl:if test="$tipoSalida=1">
            <div style="position:absolute; top:790px; left:70px;">
              Recibi Cheque
            </div>
          </xsl:if>
        </div>
       
      </div>
        </body>
      </html>
      
    </xsl:template>
  <xsl:template name="FormatDate">
    <xsl:param name="DateTime" />
    <xsl:variable name="year" select="substring($DateTime,1,4)" />
    <xsl:variable name="month-temp" select="substring-after($DateTime,'-')" />
    <xsl:variable name="month" select="substring-before($month-temp,'-')" />
    <xsl:variable name="day-temp" select="substring-after($month-temp,'-')" />
    <xsl:variable name="day" select="substring($day-temp,1,2)" />
    <xsl:variable name="time" select="substring-after($DateTime,'T')" />
    <xsl:variable name="hh" select="substring($time,1,2)" />
    <xsl:variable name="mm" select="substring($time,4,2)" />
    <xsl:variable name="ss" select="substring($time,7,2)" />

    <!-- Long DATE FORMAT -->

    <xsl:value-of select="$day"/>
    <xsl:value-of select="' de '"/>
    <!--January -->
    <!--January 12 -->
    <xsl:choose>
      <xsl:when test="$month = '1' or $month= '01'">
        Enero
      </xsl:when>
      <xsl:when test="$month = '2' or $month= '02'">
        Febrero
      </xsl:when>
      <xsl:when test="$month= '3' or $month= '03'">
        Marzo
      </xsl:when>
      <xsl:when test="$month= '4' or $month= '04'">
        Abril
      </xsl:when>
      <xsl:when test="$month= '5' or $month= '05'">
        Mayo
      </xsl:when>
      <xsl:when test="$month= '6' or $month= '06'">
        Junio
      </xsl:when>
      <xsl:when test="$month= '7' or $month= '07'">
        Julio
      </xsl:when>
      <xsl:when test="$month= '8' or $month= '08'">
        Agosto
      </xsl:when>
      <xsl:when test="$month= '9' or $month= '09'">
        Septiembre
      </xsl:when>
      <xsl:when test="$month= '10'">
        Octubre
      </xsl:when>
      <xsl:when test="$month= '11'">
        Noviembre
      </xsl:when>
      <xsl:when test="$month= '12'">
        Diciembre
      </xsl:when>
    </xsl:choose>
    <xsl:value-of select="' de'"/>
    <!--January 12,-->
    <xsl:value-of select="' '"/>
    <!--January 12, -->
    <xsl:value-of select="$year"/>
    <!--January 12, 2001-->
    <!--
    <xsl:value-of select="' a las '"/><xsl:value-of select="$hh"/><xsl:value-of select="':'"/><xsl:value-of select="$mm"/><xsl:value-of select="':'"/><xsl:value-of select="$ss"/><xsl:value-of select="' (GMT) '"/>-->
    <!-- END: Long DATE FORMAT -->

  </xsl:template>
</xsl:stylesheet>
